package com.example.flashsales.service.impl;

import com.example.flashsales.entity.pojo.User;
import com.example.flashsales.mappers.UserStateMapper;
import com.example.flashsales.service.UserStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserStateServiceImpl implements UserStateService {
    @Autowired
    UserStateMapper userStateMapper;

    /**
     * 查看用户
     * @param userId 用户id
     * @return 返回用户实体
     */
    @Override
    public User viewUser(long userId) {
        return userStateMapper.viewUser(userId);
    }


    /**
     * 修改用户状态
     * @param userId 用户id
     * @param state 状态 1冻结 0正常
     * @return 返回是否修改成功
     */
    @Override
    public int updateUserState(Long userId, int state) {
        return userStateMapper.updateUserState(userId,state);
    }
}
